/* 全局页面转场效果 - 简化版本 */

/* 基础转场容器 - 只针对页面内容 */
.page-transition-enter-active,
.page-transition-leave-active {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  width: 100%;
  min-height: 100%;
  background: #f5f5f5;
}

/* 进入动画 */
.page-transition-enter-from {
  transform: translateX(100%);
  opacity: 0;
}

/* 离开动画 */
.page-transition-leave-to {
  transform: translateX(-100%);
  opacity: 0;
}

/* 确保转场期间页面内容可见 */
.page-transition-enter-active,
.page-transition-leave-active {
  background: #f5f5f5;
  
}

/* 转场期间的性能优化 */
.page-transition-enter-active,
.page-transition-leave-active {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .page-transition-enter-active,
  .page-transition-leave-active {
    transition-duration: 0.3s;
  }
}

/* Stepin转场效果 - 完全同步左右滑动转场 */
.stepin-transition-enter-active,
.stepin-transition-leave-active {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  background: #f5f5f5;
  
  /* 确保页面位置完全稳定 */
  margin: 0;
  padding: 0;
  /* 防止页面跳动 */
  transform-origin: center center;
}

/* 转场容器 - 确保页面位置稳定 */
.stepin-transition-enter-active {
  z-index: 2; /* 新页面在上层 */
}

.stepin-transition-leave-active {
  z-index: 1; /* 原页面在下层 */
}

/* 进入动画 - 新页面从右侧滑入 */
.stepin-transition-enter-from {
  transform: translateX(100%);
  opacity: 1;
}

/* 离开动画 - 原页面向左侧滑出 */
.stepin-transition-leave-to {
  transform: translateX(-100%);
  opacity: 0;
}

/* 反向转场效果 - 用于浏览器后退操作 */
.stepin-reverse-transition-enter-active,
.stepin-reverse-transition-leave-active {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  background: #f5f5f5;
  
  /* 确保页面位置完全稳定 */
  margin: 0;
  padding: 0;
  /* 防止页面跳动 */
  transform-origin: center center;
}

/* 反向转场容器 - 确保页面位置稳定 */
.stepin-reverse-transition-enter-active {
  z-index: 2; /* 新页面在上层 */
}

.stepin-reverse-transition-leave-active {
  z-index: 1; /* 原页面在下层 */
}

/* 反向进入动画 - 新页面从左侧滑入 */
.stepin-reverse-transition-enter-from {
  transform: translateX(-100%);
  opacity: 1;
}

/* 反向离开动画 - 原页面向右侧滑出 */
.stepin-reverse-transition-leave-to {
  transform: translateX(100%);
  opacity: 0;
}

/* 转场期间的滚动条处理 */
.page-transition-enter-active,
.page-transition-leave-active,
.stepin-transition-enter-active,
.stepin-transition-leave-active {
  
  /* 防止页面跳动 */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
}

/* 转场完成后的状态 */
.page-transition-enter-to,
.page-transition-leave-from,
.stepin-transition-enter-to,
.stepin-transition-leave-from {
  transform: translateX(0);
  opacity: 1;
  overflow: visible;
}

/* 可点击元素的入场和退场动画 */
.clickable-element {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: scale(1);
  opacity: 1;
}

.clickable-element:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

.clickable-element:active {
  transform: scale(0.98);
  opacity: 0.8;
}

/* 按钮动画 */
.el-button {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform: scale(1);
}

.el-button:hover {
  transform: scale(1.02) !important;
}

.el-button:active {
  transform: scale(0.98) !important;
}

/* 链接动画 */
a, .nav-link, .auth-link {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: scale(1);
}

a:hover, .nav-link:hover, .auth-link:hover {
  transform: scale(1.02);
}

a:active, .nav-link:active, .auth-link:active {
  transform: scale(0.98);
}

/* 卡片动画 */
.el-card {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform: scale(1);
}

.el-card:hover {
  transform: scale(1.01) !important;
}

/* 输入框动画 */
.el-input__inner {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform: scale(1);
}

.el-input__inner:focus {
  transform: scale(1.01) !important;
}

/* 下拉菜单动画 */
.el-dropdown-menu__item {
  transition: all 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform: translateX(0);
}

.el-dropdown-menu__item:hover {
  transform: translateX(5px) !important;
}

/* 分页按钮动画 */
.el-pagination .el-pager li {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform: scale(1);
}

.el-pagination .el-pager li:hover {
  transform: scale(1.1) !important;
}

/* 标签页动画 */
.el-tabs__item {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform: scale(1);
}

.el-tabs__item:hover {
  transform: scale(1.05) !important;
}

/* 开关动画 */
.el-switch__core {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.el-switch__core:hover {
  transform: scale(1.05) !important;
}

/* 选择器动画 */
.el-select-dropdown__item {
  transition: all 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform: translateX(0);
}

.el-select-dropdown__item:hover {
  transform: translateX(5px) !important;
}

/* 表格行动画 */
.el-table__row {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform: scale(1);
}

.el-table__row:hover {
  transform: scale(1.005) !important;
}

/* 树形控件动画 */
.el-tree-node__content {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform: translateX(0);
}

.el-tree-node__content:hover {
  transform: translateX(5px) !important;
}

/* 步骤条动画 */
.el-step__head {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform: scale(1);
}

.el-step__head:hover {
  transform: scale(1.1) !important;
}

/* 进度条动画 */
.el-progress-bar__outer {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* 加载动画 */
.el-loading-spinner {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* 消息提示动画 */
.el-message {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform: translateY(0);
}

.el-message:hover {
  transform: translateY(-2px) !important;
}

/* 通知动画 */
.el-notification {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform: translateX(0);
}

.el-notification:hover {
  transform: translateX(-5px) !important;
}

/* 对话框动画 */
.el-dialog {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform: scale(1);
}

.el-dialog:hover {
  transform: scale(1.01) !important;
}

/* 抽屉动画 */
.el-drawer {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* 弹出框动画 */
.el-popover {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform: scale(1);
}

.el-popover:hover {
  transform: scale(1.02) !important;
}

/* 工具提示动画 */
.el-tooltip__popper {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}
